package cn.zero.flowspringbootstater.modular.vo;

import lombok.Data;

import java.util.Set;
import java.util.TreeSet;

/**
 * 节点和审核用户的对应实体
 *
 * @author lei
 * @date 2022-07-19 13:28
 */
@Data
public class FlowNode2UserVo {

    /**
     * 业务id
     */
    private String businessId;

    /**
     * 当前节点
     */

    private Long currentNodeId;



    /**
     * 当前节点有操作权限的用户，多用户以逗号分隔开
     */

    private String userIds;


    public  Set<Long>  formatUserIds() {
        TreeSet<Long> r = new TreeSet<>();
        if (userIds == null || "".equals(userIds))
        {
            return r;
        }

        for (String s : userIds.split(",")) {
            r.add(Long.parseLong(s));

        }

        return r;
    }
}
